<?php
include('functions.php');

if(isset($_COOKIE['loginInfo'])) {

	$json = curl('http://www.djmaxcn.com/crew/GetCrewHeader.asp');
    $rank = json_decode($json);
    unset($json);

    if($rank->STAT == 1) exit('发生错误, 请返回!');

    getHead('战队状态');

    echo <<<EOT
<h2>{$rank->DATA->CREWNAME}</h2>
<p>{$rank->DATA->CREWDESCRIPTION}</p>
<table style="line-height: 2em;width: 100%;">
	<tr>
		<td>累积战队排名</td>
		<td>第{$rank->DATA->CREWRANKTOTAL}名</td>
	</tr>
	<tr>
		<td>本周战队排名</td>
		<td>第{$rank->DATA->CREWRANKTOWEEK}名</td>
	</tr>
	<tr>
		<td>战队成员</td>
		<td>{$rank->DATA->CREWMEMBERCOUNT}/{$rank->DATA->CREWMEMBERLIMIT}</td>
	</tr>
	<tr>
		<td>战队队长</td>
		<td>{$rank->DATA->LEADER->DJNAME}（{$rank->DATA->LEADER->DJLEVEL}）</td>
	</tr>
	<tr>
		<td>战队副队长</td>
		<td>{$rank->DATA->CREWSUBLEADERCOUNT}/{$rank->DATA->CREWSUBLEADERLIMIT}</td>
	</tr>
	<tr>
		<td>Crew Max Point</td>
		<td>{$rank->DATA->CREWMAXPOINT} EXP</td>
	</tr>
	<tr>
		<td>Crew Challenge战况</td>
		<td>{$rank->DATA->CREWMISSIONSTAT}%达成</td>
	</tr>
</table>
EOT;

    getFoot();

} else {
	getHead('战队状态');
	echo '请<a href="login.php">登录</a>';
	getFoot(false);
}

?>